﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace MyBasicLib.Data.ORMLiteNew
{
    public interface IDbQueryProvider
    {
        //IDbQueryTranslator Translator { get; }

        //IDbCommand CreateCommand(IDbQueryable dbQueryable);   

        IDatabase Executor { get; }
        int ExecuteNonQuery<TElement>(IDbQueryable<TElement> dbQueryable);
        TElement Execute<TElement>(IDbQueryable<TElement> dbQueryable) ;
        IList<TElement> ExecuteList<TElement>(IDbQueryable<TElement> dbQueryable) ;
        //int SubmitChanges(IList<IDbQueryable> dbQueryable);
    }

    public interface ITransactionDbQueryProvider
    {
        IDatabase Executor { get; }
        int ExecuteNonQuery(IDbQueryable dbQueryable, System.Transactions.Transaction trans);
        TElement Execute<TElement>(IDbQueryable dbQueryable, System.Transactions.Transaction trans);
        IList<TElement> ExecuteList<TElement>(IDbQueryable dbQueryable, System.Transactions.Transaction trans) ;
    }
}
